﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Main.GamePlay
{
    public abstract class Ship : GameplayObject
    {
        #region Gameplay Data

        int hitsLeft = 0;
        public int HitsLeft
        {
            get { return hitsLeft; }
            set { hitsLeft = value; }
        }

        float speed;
        public float Speed
        {
            get { return speed; }
            protected set { speed = value; }
        }

        #endregion

        #region Collision Method

        public override void CollisionTRGT(GameplayObject target)
        {
            //Bullet b = target as Bullet;
            //Ship s = target as Ship;
            //if ((b != null))
            //{
            //    this.Damage();
            //    b.Die();
            //}
            //else if (s != null)
            //{
            //    this.Damage();
            //    s.Damage();
            //}
        }

        #endregion

        #region Methods

        public void Damage()
        {
            hitsLeft--;

            if (hitsLeft < 0)
                Die();
        }// control's damage taken by the ship

        #endregion
    }
}